package aad.storyboard.model;

import aad.storyboard.controller.DragDropManager;
import android.view.MotionEvent;

public class DragDropAnimation extends Animation{
	
	private int endTime;	
	private MotionEvent event;
	private Image draggedImage;
	private int X;
	private int Y;
	private int eventAction;
	private boolean newTouch=true;
		
	public DragDropAnimation (int starttime, int endtime) {
		super(starttime);
		this.setEndTime(endtime);		
	}

	@Override
	public void animate( ) {
		if (newTouch)
			{
			DragDropManager.getInstance().handleDragDrop(eventAction, X, Y);			
			}
		newTouch=false;
	}

	
	public void setNewTouch(boolean t)
	{
		newTouch=t;
	}
	
	public void setEvent(MotionEvent ev)
	{
		event=ev;
	}
	
	@Override
	public void undo() {
		// TODO Auto-generated method stub
		
	}	
	
	public void setEndTime(int endTime) {
		this.endTime = endTime;
	}

	public int getEndTime() {
		return endTime;
	}
	
	
	@Override
	public void adjustParameters() {
		// TODO Auto-generated method stub
		
	}

	public void setDraggedImage(Image img) {
		this.draggedImage=img;
		
	}


	public void setCoordinates(int x, int y) {
		this.X=x;
		this.Y=y;
		
	}

	public void setEventaction(int eventaction) {
		eventAction=eventaction;
		
	}
}
